<?php
#----------------------- TYPE CLASS ------------------------------------------------
$type_class = array();
$type_class['text'] 			= 'CFText';
$type_class['password'] 		= 'CFPassword';
$type_class['textarea'] 		= 'CFText';
$type_class['select'] 			= 'CFSelect';
$type_class['checkbox'] 		= 'CFCheckbox';
$type_class['radio'] 			= 'CFRadio';
$type_class['file'] 			= 'CFFile';
$type_class['hidden'] 			= 'CFText';

#----------------------- ERROR CONSTANT --------------------------------------------
define('_no_error_', 	  0);
define('_nonempty_', 	  1);
define('_email_', 		  2);
define('_date_', 		  4);
define('_time_', 		  8);
define('_datetime_', 	 16);
define('_number_', 		 32);
define('_alphastring_',  64);
define('_login_', 		128);
define('_dirname_', 	256);
define('_radio_',     	512);
define('_nonemptyalt_',1024);
define('_select_',     2048);

$err_info = array();
#_nonempty_
$err_info[_nonempty_]['MESS'] 		= 'Не заполнено обязательное поле';
#$err_info[_nonempty_]['MESS']['EN'] = 'Please fill in all the required fields';
$err_info[_nonempty_]['NAME'] 		= '_nonempty_';
$err_info[_nonempty_]['FUNC'] 		= 'check_nonempty';

$err_info[_radio_]['MESS']			= 'Не заполнено обязательное поле';
#$err_info[_radio_]['MESS']['EN']	= 'Please fill in all the required fields';
$err_info[_radio_]['NAME'] 			= '_radio_';
$err_info[_radio_]['FUNC'] 			= 'check_nonempty';

#_email_
$err_info[_email_]['MESS']			= 'Неверный формат email';
#$err_info[_email_]['MESS']['EN']	= 'E-mail format is not valid';
$err_info[_email_]['NAME'] 			= '_email_';
$err_info[_email_]['FUNC'] 			= 'check_email';

#_date_
$err_info[_date_]['MESS']			= 'Неверный формат даты (DD.MM.YYYY)';
#$err_info[_date_]['MESS']['EN']	= 'Date format (DD.MM.YYYY) is not valid';
$err_info[_date_]['NAME']			= '_date_';
$err_info[_date_]['FUNC'] 			= 'check_date';

#_time_
$err_info[_time_]['MESS']			= 'Неверный формат времени (HH:MM)';
#$err_info[_time_]['MESS']['EN']	= 'Time format (HH:MM) is not valid';
$err_info[_time_]['NAME']			= '_time_';
$err_info[_time_]['FUNC'] 			= 'check_time';

#_datetime_
$err_info[_datetime_]['MESS']		= 'Неверный формат даты и времени (DD.MM.YYYY HH:MM)';
#$err_info[_datetime_]['MESS']['EN']	= 'Date and time formats (DD.MM.YYYY HH:MM) are not valid';
$err_info[_datetime_]['NAME'] 		= '_datetime_';
$err_info[_datetime_]['FUNC'] 		= 'check_datetime';

#_number_
$err_info[_number_]['MESS'] 		= 'Неверный формат числа';
#$err_info[_number_]['MESS']['EN'] 	= 'Number format is not valid';
$err_info[_number_]['NAME'] 		= '_number_';
$err_info[_number_]['FUNC'] 		= 'check_number';

#_alphastring_
$err_info[_alphastring_]['MESS'] 		= 'Неверный формат (строка из латинских букв)';
#$err_info[_alphastring_]['MESS']['EN'] = 'Not valid format - string of latin letters are required';
$err_info[_alphastring_]['NAME'] 		= '_alphastring_';
$err_info[_alphastring_]['FUNC'] 		= 'check_alphastring';

#_login_
$err_info[_login_]['MESS']			= 'Неверный формат (строка из цифр или латинских букв без пробелов)';
#$err_info[_login_]['MESS']['EN']	= 'Not valid format - string of latin letters or numbers without space are required';
$err_info[_login_]['NAME'] 			= '_login_';
$err_info[_login_]['FUNC'] 			= 'check_login';

#_dirname_
$err_info[_dirname_]['MESS'] 		= 'Неверный формат (строка из латинских букв без пробелов)';
#$err_info[_dirname_]['MESS']['EN'] = 'Not valid format - string of latin letters without space are required ';
$err_info[_dirname_]['NAME'] 		= '_dirname_';
$err_info[_dirname_]['FUNC'] 		= 'check_login';

?>